package com.designpattern.observer;

/**
 * @author liyanhao
 * @Date 2023-02-17 10:21
 */
public class BaiduDisplay implements Observer {

    private float temp;
    private float humidity;
    private float pressure;
    @Override
    public void update(float temp, float humidity, float pressure) {
        this.temp = temp;
        this.humidity = humidity;
        this.pressure = pressure;
        display();
    }

    @Override
    public void display() {
        System.out.println("百度温度:"+temp+" 百度湿度:"+humidity+" 百度压力:"+pressure);
    }
}
